# 创建时间：2025/5/2 星期五 15:00
# 创建人：李德才

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def say_hello(self):
        print(f"Hello, my name is {self.name} and I am {self.age} years old.")


class Student(Person):
    def __init__(self, name, age, grade):
        super().__init__(name, age)
        self.grade = grade
        """ 学生的say_hello方法 """

    def say_hello(self):
        print(f"Hello, my name is {self.name} and I am {self.age} years old. I am in grade {self.grade}.")


class Teacher(Person):
    def __init__(self, name, age, subject):
        super().__init__(name, age)
        self.subject = subject

        """ 老师的say_hello方法 """

    def say_hello(self):
        print(f"Hello, my name is {self.name} and I am {self.age} years old. I teach {self.subject}.")


person = Person("John", 30)
student = Student("Jane", 18, "10th grade")
teacher = Teacher("Bob", 40, "Mathematics")
person.say_hello()
student.say_hello()
teacher.say_hello()
